
package com.zsrt.examsystem.stduententity;

public class Student implements Comparable<Student>{

	/**
	 * 学生的准考证号
	 */
	private String idExam;
	
	/**
	 * 学生的登录密码
	 */
	private String password;
	
	/**
	 * 学生的姓名
	 */
	private String name;
	
	/**
	 * 学生的性别
	 */
	private String sex;
	
	/**
	 * 学生的年龄
	 */
	private int age;
	
	/**
	 * 学生的省份
	 */
	private String province;
	
	/**
	 * 学生的户籍
	 */
	private String huji;
	
	/**
	 * 学生的联系方式 
	 */
	private String  phone;
	
	/**
	 * 学生的语文成绩
	 */
	private int  chineseScore;
	
	/**
	 * 学生的数学成绩
	 */
	private int  mathScore;
	
	/**
	 * 学生的英语成绩
	 */
	private int  englishScore;

	
	
	
	/**
	 * 默认构造方法
	 */
	public Student(){}
	
	/**
	 * @return the idExam
	 */
	public String getIdExam() {
		return idExam;
	}
	/**
	 * @param idExam the idExam to set
	 */
	public void setIdExam(String idExam) {
		this.idExam = idExam;
	}
	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}
	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the age
	 */
	public int getAge() {
		return age;
	}
	/**
	 * @param age the age to set
	 */
	public void setAge(int age) {
		this.age = age;
	}
	/**
	 * @return the province
	 */
	public String getProvince() {
		return province;
	}
	/**
	 * @param province the province to set
	 */
	public void setProvince(String province) {
		this.province = province;
	}
	/**
	 * @return the huji
	 */
	public String getHuji() {
		return huji;
	}
	/**
	 * @param huji the huji to set
	 */
	public void setHuji(String huji) {
		this.huji = huji;
	}
	/**
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}
	/**
	 * @param phone the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}
	/**
	 * @return the chineseScore
	 */
	public int getChineseScore() {
		return chineseScore;
	}
	/**
	 * @param chineseScore the chineseScore to set
	 */
	public void setChineseScore(int chineseScore) {
		this.chineseScore = chineseScore;
	}
	/**
	 * @return the mathScore
	 */
	public int getMathScore() {
		return mathScore;
	}
	/**
	 * @param mathScore the mathScore to set
	 */
	public void setMathScore(int mathScore4) {
		mathScore = mathScore4;
	}
	/**
	 * @return the englishScore
	 */
	public int getEnglishScore() {
		return englishScore;
	}
	/**
	 * @param englishScore the englishScore to set
	 */
	public void setEnglishScore(int englishScore) {
		this.englishScore = englishScore;
	}
	/**
	 * @param idExam
	 * @param password
	 * @param name
	 * @param sex
	 * @param age
	 * @param province
	 * @param huji
	 * @param phone
	 * @param chineseScore
	 * @param mathScore
	 * @param englishScore
	 */
	public Student(String idExam, String password, String name, String sex, int age, String province, String huji,
			String phone, int chineseScore, int mathScore, int englishScore) {
		super();
		this.idExam = idExam;
		this.password = password;
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.province = province;
		this.huji = huji;
		this.phone = phone;
		this.chineseScore = chineseScore;
		this.mathScore = mathScore;
		this.englishScore = englishScore;
	}
	
	@Override
	public String toString() {
		return "Student [idExam=" + idExam + ", password=" + password + ", name=" + name + ", sex=" + sex + ", age="
				+ age + ", province=" + province + ", huji=" + huji + ", phone=" + phone + ", chineseScore="
				+ chineseScore + ", mathScore=" + mathScore + ", englishScore=" + englishScore + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */


	
	@Override
	public int compareTo(Student o) {

		int totalScore = o.getChineseScore()+o.getEnglishScore()+o.getMathScore();

		int totalScore1 = this.getChineseScore()+this.getEnglishScore()+this.getMathScore();
		
		if(totalScore1 - totalScore<=0){
			
			return  1;
		}else{
			return -1;
		}
	}
	
	
	
	
	
}
